package com.neoCalf.neoCommon.enums;


import com.neoCalf.neoCommon.utils.DataTool;
import lombok.Getter;

@Getter
public enum UserStatusEnum {
    SHUT_DOWN(0, "封禁"),

    NORMAL(1, "正常");

    private final int type;
    private final String description;

    UserStatusEnum(int type, String description) {
        this.type = type;
        this.description = description;
    }

    public static UserStatusEnum getByType(Integer type) {
        if (DataTool.isNull(type)) {
            return null;
        }
        for (UserStatusEnum typeEnum : UserStatusEnum.values()) {
            if (typeEnum.getType() == type) {
                return typeEnum;
            }
        }
        return null;
    }
}
